<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="ssm" uri="http://ssm.elangzhi.com/jsp/tag/functions" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
Created by GaoXiang
Date: 2020-10-12 11:33:29 星期一
Version: 1.0
评价编辑页面
--%>

<div class="portlet light" >
    <div class="portlet-body form">
        <!-- BEGIN FORM-->
        <form action="#" class="form-horizontal" id="edit-module">
            <div class="form-body">

                <div class="row">
                    <div class="col-md-6 hide">
                        <div class="form-group">
                            <label class="control-label col-md-3">ID</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" name="id" value="${data.id}" placeholder="默认生成，ID">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6 hide">
                        <div class="form-group">
                            <label class="control-label col-md-3">workersId</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" readonly name="workersId" value="${data.workersId}" placeholder="workersId">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">人员姓名</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" readonly name="workersName" value="${data.workersName}">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">评价状态</label>
                            <div class="col-md-9">
                                <select  class="form-control" required name="ratingType">
                                    <option value="0" <c:if test="${data.ratingType == 0}">selected</c:if>>不满意</option>
                                    <option value="1" <c:if test="${data.ratingType == 1}">selected</c:if>>一般</option>
                                    <option value="2" <c:if test="${data.ratingType == 2}">selected</c:if>>满意</option>
                                    <option value="3" <c:if test="${data.ratingType == 3}">selected</c:if>>非常满意</option>
                                </select>
                               <%-- <input type="text" class="form-control" required name="ratingType" value="${data.ratingType}" placeholder="ratingType">--%>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">评价人姓名</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" readonly name="userName" value="${data.userName}">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">评价人手机号</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" readonly name="userPhone" value="${data.userPhone}">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">反馈信息</label>
                            <div class="col-md-9">
                                <textarea type="text" class="form-control" cols="10" readonly name="feedbackInfo">${data.feedbackInfo}</textarea>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-3">简述事项</label>
                            <div class="col-md-9">
                                <textarea type="text" cols="10" class="form-control" readonly name="resumeReason">${data.resumeReason}</textarea>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            <div class="form-actions">
                <div class="row">
                    <div class="col-md-6">
                        <div class="row">
                            <div class="col-md-offset-3 col-md-9">
                                <button type="button" class="btn green" onclick="edit();">修改评价</button>
                                <button type="button" class="btn default" onclick="layer.close(layer_editModule);">取消</button>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6"> </div>
                </div>
            </div>
        </form>
        <!-- END FORM-->
    </div>
</div>
<!-- script 开始 -->
<script>

    $(function(){
        //初始化页面
        initPage();
    });

    /**
     * 保存编辑的评价
     */
    function edit(){
        var param = tools.formParams("edit-module");
        if(tools.valid("edit-module")){
            tools.post("/evaluateUser/update",param,function(data){
                if(data.success){
                    layer.msg('评价修改成功', {icon: 1,time:1000},function(){
                        //刷新列表页面
                        toPage(null);
                        //关闭弹窗
                        layer.close(layer_editModule);
                    });
                }else{
                    tools.errorTip(data.code,data.msg);
                }
            });
        }
    }
</script>
<!-- script 结束 -->